#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

// set NOISY_TEST to 0 to remove printfs from output
#define NOISY_TEST 1

int main() {
    int seed = 500;
    int numPlayer = 2;
    int p, r, handCount;
	int x, y; 
    int k[10] = {adventurer, council_room, feast, gardens, mine
               , remodel, smithy, village, baron, great_hall};
    struct gameState G;
    int maxHandCount = 5;

	memset(&G, 23, sizeof(struct gameState));   // clear the game state
	r = initializeGame(numPlayer, k, seed, &G); // initialize a new game

    printf ("TESTING getCost():\n");
    for (p = 0; p < numPlayer; p++)
    {
        for (handCount = 1; handCount <= maxHandCount; handCount++)
        {
			memcpy(G.hand[p], k, sizeof(int) * handCount); // consecutively set each card in hand to the kingdom cards in k

			x = handCard(handCount - 1, &G); // get the index number of the card based on the enum CARD in dominion.h
			y = getCost(x);

			#if (NOISY_TEST == 1)
				printf("Player %d, Card ENUM Value = %d, Cost = %d\n", p, x, y);
			#endif
			assert(y != -1);
	
        }
		printf("\n");
		endTurn(&G);
    }

    printf("All getCost tests completed!\n");

    return 0;
}
